<div class="file" id="List">
    <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#686550">
        <tr class="heading"  bgcolor="#708089">
            <td width="6%" valign="top" align="left"><?php echo __('S.NO') ?></td>
            <td valign="top"  align="left"><?php echo  __('RECEIVED_DATE', true); ?></td>
            <td valign="top"  align ="left"><?php echo  __('SENT_BY', true); ?></td>
            <td valign="top"  align ="left"><?php echo __('EMAIL_TYPE'); ?></td>
            <td valign="top"  align="left"><?php echo __('ACTION'); ?></td>
        </tr>
        <?php
        if (isset($associatedMail) && count($associatedMail) > 0) {
            $i = 0;
            foreach ($associatedMail as $arrayDetail) {
                ?>
                <tr class="heading2" bgcolor="#ffffff">
                    <td>&nbsp;<?php echo $i + 1 ?></td>
                    <td>&nbsp;<?php echo date('M j, Y', strtotime($arrayDetail['UserMail']['created'])); ?></td>
                    <td>&nbsp;<?php echo $arrayDetail['User']['e_name']; ?></td>
                    <td>&nbsp;<?php echo $arrayDetail['Mail']['mail_type']; ?></td>
                    <td>
                        <?php 
                            echo $this->Html->link(
                                    $this->Html->image('icons/16/icon_view.gif', array("alt" => "eBox")), '#', array(
                                    'target' => '_blank',
                                    'escape' => false,
                                    'onClick' => "window.open('".$this->Html->url(array(
                                        'controller' => 'payrolls',
                                        'action' => 'check_email_history/'.$arrayDetail['Mail']['id'],
                                    ))."', 'windowname','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=550,height=500'); return false;"
                                ));
                        ?>
                    </td>
                </tr>  
                <?php
                $i++;
            }
        } else{ ?>
            <tr>
                <td colspan="5" bgcolor="#ffffff" align="center">
                    <div class="pagination"><?php echo __("NO_RECORD_MESSAGE");  ?></div>
                </td>
            </tr> <?php
            }
        ?>
    
        <tr bgcolor="#ffffff">
            <td colspan="11" valign="top">
                <table width="30%">
                    <tr>
                        <td width="10%">
                            <b><?php echo __('LEGENDS') ?> :- </b> 
                        </td>
                        <td width="20%">
                            <?php echo $this->html->image('/img/icons/16/icon_view.gif'); ?>
                            <?php echo __('VIEW') ?>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>